package com.six.backend.utils;

import io.jsonwebtoken.Claims;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: skyler
 * @Date: 2021/11/17 14:18
 */
public class TokenUtil {

    public static String getTokenName(HttpServletRequest servletRequest) {
        String authorization = servletRequest.getHeader("Authorization");
        if (authorization != null) {
            Claims claims = JwtUtil.parseJWT(authorization);
            String account = claims.getId();
            return account;
        }
        return null;

    }
}
